package com.sphd.emanu.retrofitUtil;

import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.sphd.emanu.config.Constant;
import com.sphd.emanu.pojo.CategoryAndStorageEntity;
import com.sphd.emanu.pojo.HomeFragmentInfo;
import com.sphd.emanu.pojo.MonthOrYearInfo;
import com.sphd.emanu.pojo.bank.BankListInfo;
import com.sphd.emanu.pojo.bank.BankMessageInfo;
import com.sphd.emanu.pojo.bank.CardNumMessage;
import com.sphd.emanu.pojo.bank.DayDetailMessage;
import com.sphd.emanu.pojo.bank.DetailsInfo;
import com.sphd.emanu.pojo.bank.TimeShowMoneyMessage;
import com.sphd.emanu.pojo.login.User;


import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * @Author Hu
 * @Time 2017/5/8 --11:12.
 * @Email 87683202@qq.com
 */
public interface EmanuService {
    /*登录接口*/
    @POST(Constant.PHONE_LOGIN)
    Call<String> login(@Query(value = "logonname") String logonname, @Query(value = "logonpwd") String logonpwd
            , @Query(value = "deviceType") int deviceType, @Query(value = "token") String token);

    /*--------------------------------商品模块--------------------------------------------------*/
    /*商品模块--分类列表的展示*/
    @GET(Constant.CLASSIFY_LIST)
    Call<String> classfylist(@Query(value = "oid") int oid);

    /*商品模块--新建分类*/
    @GET(Constant.ADD_CATEGORY)
    Call<JsonObject> addCategory(@Query(value = "name") String name, @Query(value = "org") int org);

    /*商品模块--更新分类*/
    @GET(Constant.UPDATE_CATEGORY)
    Call<JsonObject> updateCategory(@Query(value = "id") int id, @Query(value = "name") String name, @Query(value = "org") int org);
    /*商品模块--更新分类*/

    @GET(Constant.DEL_CATEGORY)
    Call<JsonObject> deleteCategory(@Query(value = "id") int id);

    /*根据分类id获取菜品列表*/
    @GET(Constant.SELECT_COMMODITY)
    Call<String> selectCommodity(@Query(value = "id") int id);

    /*获取商品构成*/
    @GET(Constant.SELECT_COMPOSITION)
    Call<JsonObject> selectComposition(@Query(value = "id") int id);

    /*新增构成*/
//    parent=商品id, name=物料名称,amount=需要重量,material=,categoryName=物料类型,specifications=规格
    @GET(Constant.ADD_COMPOSITION)
    Call<JsonObject> addComposition(@Query("parent") int id, @Query("name") String name, @Query("specifications") String specifications,
                                    @Query("categoryName") String categoryName, @Query("amount") Integer amount, @Query("material") int materialId);

    /*修改构成*/
    @GET(Constant.UPDATE_COMPOSITION)
    Call<JsonObject> updateComposition(@Query("id") int id, @Query("name") String name, @Query("specifications") String specifications,
                                       @Query("model") String model, @Query("amount") Integer amount);

    /*删除构成*/
    @GET(Constant.DEL_COMPOSITION)
    Call<JsonObject> deleteComposition(@Query(value = "id") int id);

    /*新增商品*/
    @Multipart
    @POST(Constant.ADD_COMMODITY)
    Call<JsonObject> addCommodity(@Query(value = "name") String name, @Query(value = "category") int categoryId,
                                  @Part MultipartBody.Part imgs
            , @Query(value = "netWeight") BigDecimal netWeight, @Query(value = "unitPrice") BigDecimal unitPrice
            , @Query(value = "discountable") boolean discountable, @Query(value = "shelved") boolean shelved, @Query(value = "oid") int oid
    );  /*新增商品*/

    @POST(Constant.ADD_COMMODITY)
    Call<JsonObject> addCommodityNoImage(@Query(value = "name") String name, @Query(value = "category") int categoryId,
                                         @Query(value = "netWeight") BigDecimal netWeight, @Query(value = "unitPrice") BigDecimal unitPrice
            , @Query(value = "discountable") boolean discountable, @Query(value = "shelved") boolean shelved, @Query(value = "oid") int oid
    );

    /*修改商品*/
    @Multipart
    @POST(Constant.UPDATE_COMMODITY)
    Call<JsonObject> updateCommodity(@Query(value = "id") int id, @Query(value = "name") String name, @Query(value = "category")
            int categoryId,
                                     @Part MultipartBody.Part imgs
            , @Query(value = "netWeight") BigDecimal netWeight, @Query(value = "unitPrice") BigDecimal unitPrice
            , @Query(value = "discountable") boolean discountable, @Query(value = "shelved") boolean shelved,
                                     @Query(value = "oid") int oid);

    @GET(Constant.UPDATE_COMMODITY)
    Call<JsonObject> updateCommodity(@Query(value = "id") int id, @Query(value = "reserveStock") Integer reserveStock);

    /*修改商品*/
    @POST(Constant.UPDATE_COMMODITY)
    Call<JsonObject> updateCommodityNoImage(@Query(value = "id") int id, @Query(value = "name") String name, @Query(value = "category")
            int categoryId
            , @Query(value = "netWeight") BigDecimal netWeight, @Query(value = "unitPrice") BigDecimal unitPrice
            , @Query(value = "discountable") boolean discountable, @Query(value = "shelved") boolean shelved,
                                            @Query(value = "oid") int oid);  /*修改商品*/

    /*修改构成*/
    @POST(Constant.UPDATE_COMMODITY)
    Call<JsonObject> updateCommoditySrcCome(@Query(value = "id") int id, @Query(value = "source") String source, @Query(value = "composition")
            String composition, @Query(value = "category") int categoryId,
                                            @Query(value = "oid") int oid);

    /*删除商品*/
    @GET(Constant.DEL_COMMODITY)
    Call<JsonObject> deleteCommodity(@Query(value = "id") int id);
    /*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-------库房模块------------------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/

    /**
     * 第一分类
     *
     * @param org 餐馆id
     * @return
     */
    @GET(Constant.FIRST_CATEGORY)
    Call<String> selectFristCategory(@Query(value = "org") int org);

    /**
     * 第二分类
     *
     * @param
     * @return
     */
    @GET(Constant.NEXT_CATEGORY)
    Call<String> selectNextCategory(@Query(value = "id") int id);

    /**
     * @param org
     * @return 获取分类与库位的列表
     */
    @GET(Constant.CATEGOR_AND_STORAGE)
    Call<String> categorAndStorage(@Query(value = "org") int org, @Query(value = "categoryId") Integer categoryId);


    @GET(Constant.UP_MATERIAL)
    Call<JsonObject> updateMaterial(@Query(value = "id") int id,
                                    @Query(value = "name") String name,
                                    @Query(value = "specifications") String specifications,
                                    @Query(value = "category") Integer category,
                                    @Query(value = "minimum_stock") String minimum_stock,
                                    @Query(value = "stock") String stock,
                                    @Query(value = "storage") Integer storage);

    @GET(Constant.UP_MATERIAL)
    Call<JsonObject> updateMaterialNoStorage(@Query(value = "id") int id,
                                             @Query(value = "name") String name,
                                             @Query(value = "specifications") String specifications,
                                             @Query(value = "category") Integer category,
                                             @Query(value = "minimum_stock") String minimum_stock,
                                             @Query(value = "stock") String stock);

    @GET(Constant.ADD_MATERIAL)
    Call<JsonObject> addMaterial(@Query(value = "name") String name,
                                 @Query(value = "specifications") String specifications,
                                 @Query(value = "category") Integer category,
                                 @Query(value = "minimum_stock") String minimum_stock,
                                 @Query(value = "stock") String stock,
                                 @Query(value = "storage") Integer storage);

    @GET(Constant.ADD_MATERIAL)
    Call<JsonObject> adddateMaterialNoStorage(@Query(value = "name") String name,
                                              @Query(value = "specifications") String specifications,
                                              @Query(value = "category") Integer category,
                                              @Query(value = "minimum_stock") String minimum_stock,
                                              @Query(value = "stock") String stock);

    /**
     * @param id
     * @return 删除物料
     */
    @GET(Constant.DEL_MATERIAL)
    Call<JsonObject> deleteMaterial(@Query(value = "id") int id);

    /**
     * @param org
     * @return 获取库位列表
     */
    @GET(Constant.SELECT_STORAGE)
    Call<String> selectStorage(@Query(value = "org") int org);

    /**
     * 添加库位
     *
     * @param sn
     * @param name
     * @param fullName
     * @param volume
     * @param org
     * @return
     */
    @GET(Constant.ADD_STORAGE)
    Call<JsonObject> addStorage(
            @Query(value = "sn") Integer sn, @Query(value = "name") String name,
            @Query(value = "fullName") String fullName,
            @Query(value = "volume") Long volume,
            @Query(value = "org") int org);

    /**
     * 修改库位
     *
     * @param id
     * @param sn
     * @param name
     * @param fullName
     * @param volume
     * @param org
     * @return
     */
    @GET(Constant.UP_STORAGE)
    Call<JsonObject> updateStorage(@Query(value = "id") int id, @Query(value = "sn") Integer sn, @Query(value = "name") String name,
                                   @Query(value = "fullName") String fullName,
                                   @Query(value = "volume") Long volume,
                                   @Query(value = "org") int org);

    /**
     * 删除库位
     *
     * @param id
     * @return
     */
    @GET(Constant.DEL_STORAGE)
    Call<JsonObject> deleteStorage(@Query(value = "id") int id);


    /**
     * @param level
     * @param name
     * @param org
     * @return
     */
    @GET(Constant.ADD_MATERIAL_CATEGORY)
    Call<JsonObject> addMaterialCategory(@Query(value = "level") Integer level, @Query(value = "name") String name,
                                         @Query(value = "org") Integer org);

    @GET(Constant.ADD_MATERIAL_CATEGORY)
    Call<JsonObject> addMaterialCategory(@Query(value = "level") Integer level, @Query(value = "name") String name,
                                         @Query(value = "org") Integer org, @Query(value = "parent") Integer parent);

    @GET(Constant.UP_MATERIAL_CATEGORY)
    Call<JsonObject> updateMaterialCategory(@Query(value = "id") Integer id, @Query(value = "level") Integer level, @Query(value = "name") String name,
                                            @Query(value = "org") Integer org);

    @GET(Constant.UP_MATERIAL_CATEGORY)
    Call<JsonObject> updateMaterialCategory(@Query(value = "id") Integer id, @Query(value = "level") Integer level, @Query(value = "name") String name,
                                            @Query(value = "org") Integer org, @Query(value = "parent") Integer parent);

    @GET(Constant.DEL_MATERIAL_CATEGORY)
    Call<JsonObject> deleteMaterialCategory(@Query(value = "id") Integer id);


    /**
     * 营销界面信息
     *
     * @param org
     * @return
     */
    @GET(Constant.SELECT_RULES)
    Call<String> selectRules(@Query(value = "org") int org);

    /**
     * 修改外送
     */
    @GET(Constant.UP_CONFIG)
    Call<JsonObject> updateConfig(@Query(value = "id") Integer id,
                                  @Query(value = "org") Integer org,
                                  @Query(value = "isOutside") Boolean isOutside,
                                  @Query(value = "earlyTime") Integer earlyTime,
                                  @Query(value = "distance") Integer distance,
                                  @Query(value = "amountLimit") BigDecimal amountLimit,
                                  @Query(value = "memo") String memo,
                                  @Query(value = "fee") BigDecimal fee,
                                  @Query(value = "amountFree") BigDecimal amountFree);

    /*外送时间表*/
    @GET(Constant.SELECT_ARRIVE_TIME)
    Call<String> selectArriveTime(@Query(value = "org") int org);

    /**
     * 添加外送时间
     *
     * @param org
     * @param arriveTime
     * @param offset
     * @return
     */
    @GET(Constant.ADD_ARRIVE_TIME)
    Call<JsonObject> addArriveTime(@Query(value = "org") int org, @Query(value = "arriveTime") String arriveTime,
                                   @Query(value = "offset") Integer offset);

    /**
     * 修改外送时间
     *
     * @param id
     * @param arriveTime
     * @param offset
     * @return
     */
    @GET(Constant.UP_ARRIVE_TIME)
    Call<JsonObject> updateArriveTime(@Query(value = "id") Integer id,
                                      @Query(value = "arriveTime") String arriveTime,
                                      @Query(value = "offset") Integer offset);

    /**
     * 删除外送时间
     *
     * @param id
     * @return
     */
    @GET(Constant.DEL_ARRIVE_TIME)
    Call<JsonObject> deleteArriveTime(@Query(value = "id") int id);

    /**
     * 更新优惠券信息
     */
    @GET(Constant.UP_COUPON)
    Call<JsonObject> updateCoupon(@Query(value = "id") Integer id,
                                  @Query(value = "enable") Boolean enable,
                                  @Query(value = "threshold") BigDecimal threshold,
                                  @Query(value = "coupon") BigDecimal coupon,
                                  @Query(value = "conditions") BigDecimal conditions
            , @Query(value = "expireDays") Integer expireDays,
                                  @Query(value = "isLoop") Boolean isLoop,
                                  @Query(value = "configId") Integer configId,
                                  @Query(value = "isCoupon")
                                          Boolean isCoupon,
                                  @Query(value = "org") Integer org
    );

    /**
     * 充值列表
     *
     * @param org
     * @return
     */
    @GET(Constant.SELECT_DEPOSIT)
    Call<String> selectDeposit(@Query(value = "org") int org);

    /**
     * 更新充值item
     */
    @GET(Constant.UP_DEPOSIT)
    Call<JsonObject> updateDeposit(@Query(value = "id") int id, @Query(value = "org") int org, @Query(value = "enable") Boolean enable, @Query(value = "threshold") BigDecimal threshold
            , @Query(value = "amount") BigDecimal amount);

    /**
     * @param org
     * @param enable
     * @param threshold
     * @param amount
     * @return 添加充值item
     */
    @GET(Constant.ADD_DEPOSIT)
    Call<JsonObject> addDeposit(@Query(value = "org") int org, @Query(value = "enable") Boolean enable, @Query(value = "threshold") BigDecimal threshold
            , @Query(value = "amount") BigDecimal amount);

    /**
     * 删除充值item
     *
     * @param id
     * @return
     */
    @GET(Constant.DEL_DEPOSIT)
    Call<JsonObject> deleteDeposit(@Query(value = "id") int id);

    /**
     * 开启关闭充值服务
     *
     * @param configId
     * @param isDeposit
     * @return
     */
    @GET(Constant.UP_IS_DEPOSIT)
    Call<JsonObject> updateIsDeposit(@Query(value = "configId") Integer configId, @Query(value = "isDeposit") Boolean isDeposit);

    /**
     * 更新折扣信息
     */
    @GET(Constant.UP_DISCOUNT)
    Call<JsonObject> updateDiscount(@Query(value = "id") Integer id,
                                    @Query(value = "enabled") Boolean enabled,
                                    @Query(value = "discountRate") Integer discountRate,
                                    @Query(value = "advanceEnabled") Boolean advanceEnabled,
                                    @Query(value = "advanceRate") Integer advanceRate,
                                    @Query(value = "advanceTime") Integer advanceTime,
                                    @Query(value = "isLoop") Boolean isLoop);

    /**
     * 获取积分商品
     *
     * @param org
     * @return
     */
    @GET(Constant.SELECT_POINTS)
    Call<String> selectPoints(@Query(value = "org") Integer org);

    /**
     * 充值积分设置
     */
    @GET(Constant.UP_DES_POINTS)
    Call<JsonObject> updateDepositPoints(@Query(value = "id") Integer id, @Query(value = "enable") boolean enable,
                                         @Query(value = "amount") BigDecimal amount,
                                         @Query(value = "ponits") Integer ponits);

    /**
     * 消费积分设置
     *
     * @param id2
     * @param enable2
     * @param type2
     * @param amount2
     * @param points2
     * @param id3
     * @param enable3
     * @param type3
     * @param amount3
     * @param points3
     * @return
     */
    @GET(Constant.UP_PAY_POINTS)
    Call<JsonObject> updatePayPoints(@Query(value = "id2") Integer id2,
                                     @Query(value = "enable2") boolean enable2,
                                     @Query(value = "type2") String type2, @Query(value = "amount2") BigDecimal amount2,
                                     @Query(value = "points2") Integer points2, @Query(value = "id3") Integer id3,
                                     @Query(value = "enable3") boolean enable3, @Query(value = "type3") String type3,
                                     @Query(value = "amount3") BigDecimal amount3, @Query(value = "points3") Integer points3);


    /**
     * 修改积分设置
     */
    @GET(Constant.UP_CONFIG)
    Call<JsonObject> updateConfig(@Query(value = "id") Integer id,
                                  @Query(value = "org") Integer org,
                                  @Query(value = "isPiont") Boolean isPiont);

    @GET(Constant.SELECT_POINTS_COMMONDITY)
    Call<String> selectPointsCommondity(@Query(value = "org") Integer org);

    @GET(Constant.UP_POINTS_COMMONDITY)
    Call<JsonObject> updatePointsCommondity(@Query(value = "materialId") int materialId, @Query(value = "commondityId") int commondityId,
                                            @Query(value = "points") Integer points);

    @GET(Constant.ADD_POINTS_COMMONDITY)
    Call<JsonObject> addPointsCommondity(@Query(value = "commondityId") int commondityId,
                                         @Query(value = "points") int points);

    @GET(Constant.DEL_POINTS_COMMONDITY)
    Call<JsonObject> delPointsCommondity(@Query(value = "materialId") int materialId);

    @GET(Constant.SELECT_MEMBER)
    Call<String> selectMember(@Query(value = "org") int org, @Query(value = "status") Integer status);

    @GET(Constant.FIND_MEMBER)
    Call<String> findMember(@Query(value = "org") int org, @Query(value = "id") Integer id);

    @GET(Constant.FIND_MEMBER_DEPOSIT)
    Call<String> findMemberDeposit(@Query(value = "org") int org, @Query(value = "id") Integer id);

    @GET(Constant.ADD_COUPON_FOR_MEMBER)
    Call<JsonObject> addCouponForMember(@Query(value = "member") int member, @Query(value = "number") int number, @Query(value = "org") int org);

    @GET(Constant.FIND_MEMBER_POINT)
    Call<String> findMemberPoint(@Query(value = "member") int member, @Query(value = "org") int org, @Query(value = "status") int status);

    @GET(Constant.GET_MEMBER_POINT)
    Call<JsonObject> getMemberPoint(@Query(value = "member") int member, @Query(value = "org") int org, @Query(value = "number") int number);

    @GET(Constant.SELECT_ORDER)
    Call<String> selectOrder(@Query(value = "org") int org, @Query(value = "status") String status);

    @GET(Constant.SELECT_ORDER_ITEM)
    Call<String> selectOrderItems(@Query(value = "id") int id);

    /*状态,0-客户申请,1-未入账,2-已入账,*/
    @GET(Constant.SELECT_DEPOSIT_ORDER)
    Call<String> selectDepositOrder(@Query(value = "org") int org, @Query(value = "status") String status);

    /*确认入账*/
    @GET(Constant.END_DEPOSIT_ORDER)
    Call<JsonObject> enterDepositOrder(@Query(value = "orderId") int orderId);

    /*新版通用框架主页接口*/
    @FormUrlEncoded
    @POST("/appCommodity/financialHomepage.do?")
    Call<HomeFragmentInfo> financialHomepage(@Field("oid") int oid);//需要传入oid机构id

    /*本月上月本年按时间查看收入指出余额*/
    @FormUrlEncoded
    @POST("/appCommodity/getAllAccountData.do?")
    Call<MonthOrYearInfo> getAllAccountData(@FieldMap Map<String, String> map);

    /*按照账户查看*/
    @FormUrlEncoded
    @POST("/appCommodity/getAccountPeriodListByAccount.do?")
    Call<CardNumMessage> getAccountPeriodListByAccount(@FieldMap Map<String, String> map);

    /* 获取本月、上月、本年 所有账户按时间查看收入、支出、余额接口*/
    @FormUrlEncoded
    @POST("/appCommodity/getAccountPeriodListByDate.do?")
    Call<TimeShowMoneyMessage> getAccountPeriodListByDate(@FieldMap Map<String, String> map);

    //每天的明细列表
//    @FormUrlEncoded
    @POST("/appCommodity/getDetailListByDay.do?")
//    Call<DayDetailMessage> getDetailListByDay(@FieldMap Map<String, String> map);
    Call<DayDetailMessage> getDetailListByDay(@Query(value = "oid") Integer oid,
                                              @Query(value = "oneDay") String oneDay,
                                              @Query(value = "fid") String fid);

    //获取单条明细的接口
    @FormUrlEncoded
    @POST("/appCommodity/getDetail.do?")
    Call<DetailsInfo> getDetail(@Field("detatilId") int detatilId);

    /*财物信息接口*/
    @FormUrlEncoded
    @POST("/appManage/getAllAccount.do?")
    Call<List<BankListInfo>> financialManger(@Field("oId") int oId);//财务管理所有账户列表

    @FormUrlEncoded
    @POST("/appManage/saveAccount.do?")
    Call<ResponseBody> addAccount(@FieldMap Map<String, String> map);//添加帐户信息

    @FormUrlEncoded
    @POST("/appManage/financeAccount.do?")
    Call<BankMessageInfo> accountMessage(@Field("id") String id);//帐户信息获取

    @FormUrlEncoded
    @POST("/appManage/bankAccountBalanceForChange.do?")
    Call<ResponseBody> changeAccountRequest(@FieldMap Map<String, String> map);//修改账号请求提交

    @FormUrlEncoded
    @POST(Constant.SELECT_USER)
    Call<String> selectUser(@Field(value = "org") Integer org);

    @GET(Constant.DEL_STAFF)
    Call<JsonObject> deleteUser(@Query(value = "userid") Integer id);

    @GET(Constant.ADD_STAFF)
    Call<JsonObject> addUser(@Query(value = "mobile") String mobile
            , @Query(value = "oid") Integer oid
            , @Query(value = "roleid") Integer roleid
            , @Query(value = "rolename") String rolename
            , @Query(value = "logonname") String logonname
            , @Query(value = "logonpwd") String logonpwd
            , @Query(value = "username") String username);

    @GET(Constant.UP_STAFF)
    Call<JsonObject> updateUser(@Query(value = "userid") Integer id
            , @Query(value = "mobile") String mobile
            , @Query(value = "oid") Integer oid
            , @Query(value = "roleid") Integer roleid
            , @Query(value = "rolename") String rolename
            , @Query(value = "logonname") String logonname
            , @Query(value = "logonpwd") String logonpwd
            , @Query(value = "username") String username);

    @GET(Constant.SELECT_MANAGER)
    Call<String> selectManageUser(@Query(value = "org") Integer org);

    //修改密码
    @GET(Constant.UPDATE_PWD)
    Call<JsonObject> updatePassword(@Query(value = "logonname")
                                            String logonname, @Query(value = "logonpwd") String logonpwd);

    //获取通讯录
    @GET(Constant.SELECT_USER_PHONE)
    Call<String> selectUserPhone(@Query(value = "org") Integer org);

    @Multipart
    @POST(Constant.UP_STAFF)
    Call<JsonObject> updateUserImage(@Query(value = "userid") Integer id, @Part MultipartBody.Part image);

    //商品库存列表接口
    @GET(Constant.COMMODITY_STOCK)
    Call<String> commodityStock(@Query(value = "org") Integer org,
                                @Query(value = "status") Integer status,
                                @Query(value = "curpage") Integer curpage,
                                @Query(value = "pageno") Integer pageno);

    @GET(Constant.COMMODITY_STOCK_BY_CATEGORY)
    Call<String> commodityStockByCategory(@Query(value = "id") Integer id,
                                          @Query(value = "status") Integer status,
                                          @Query(value = "curpage") Integer curpage,
                                          @Query(value = "pageno") Integer pageno);

    @GET(Constant.COMMODITY_PV_SUM)
    Call<String> commodityPvSum(@Query(value = "id") Integer id);

    /**
     * 消息列表 已处理 和未处理
     * 传值state //1-未处理  2-已处理
     * curpage;//当前第几页
     * pageno;//一页多少条
     * user;//userId
     *
     * @return
     */
    @GET(Constant.LIST_MESSAGE)
    Call<String> listMessage(@Query(value = "state") Integer state, @Query(value = "user") Integer userId,
                             @Query(value = "curpage") Integer curpage, @Query(value = "pageno") Integer pageno);

    /**
     * @return id 消息id,
     * state 接受传2,忽略传3
     */
    @GET(Constant.UPDATE_MSG)
    Call<JsonObject> updateMessage(@Query(value = "id") Integer id, @Query(value = "state") Integer state);

    @GET(Constant.SELECT_ORG)
    Call<String> selectOrg(@Query(value = "org") Integer org);

    /*
    *
    id //id
    name
    address                            
    phone
            openingTime//开始营业时间.只有这俩个时间在那个config里面
    closingTime//关门时间
            xwgs84//经度,用外面的,修改是传小写
    ywgs84//纬度,用外面的,修改是传小写
            description//简介
    photo
    * */
    @Multipart
    @POST(Constant.UPDATE_ORG)
    Call<JsonObject> updateOrg(@Query(value = "id") Integer id,
                               @Query(value = "name") String name,
                               @Query(value = "address") String address, @Query(value = "phone") String phone,
                               @Query(value = "openingTime") String openingTime,
                               @Query(value = "closingTime") String closingTime,
                               @Query(value = "xwgs84") double xwgs84,
                               @Query(value = "ywgs84") double ywgs84,
                               @Query(value = "description") String description,
                               @Part MultipartBody.Part photo
    );

    @GET(Constant.UPDATE_ORG)
    Call<JsonObject> updateOrg(@Query(value = "id") Integer id,
                               @Query(value = "name") String name,
                               @Query(value = "address") String address, @Query(value = "phone") String phone,
                               @Query(value = "openingTime") String openingTime,
                               @Query(value = "closingTime") String closingTime,
                               @Query(value = "xwgs84") double xwgs84,
                               @Query(value = "ywgs84") double ywgs84,
                               @Query(value = "description") String description

    );

    @GET(Constant.UP_ORDER_STATUS)
    Call<JsonObject> updateOrderStatus(@Query(value = "orderId") Integer orderId, @Query(value = "status") int status);

    @GET(Constant.SELECT_ORDER_SEND)
    Call<String> selectOrderSend(@Query(value = "org") Integer org, @Query(value = "status") int status
            , @Query(value = "curpage") int curpage, @Query(value = "pageno") int pageno);

    //5.销售额主页
    @GET(Constant.SALE_INDEX)
    Call<String> saleIndex(@Query(value = "org") Integer org);

    @GET(Constant.SAKE_DAY_DEPOSIT_SUM)
    Call<String> saleDayDepositSum(@Query(value = "org") Integer org, @Query(value = "date") String date);

    @GET(Constant.SAKE_MONTH_DEPOSIT_SUM)
    Call<String> saleMonthDepositSum(@Query(value = "org") Integer org);

    //saleMonthSum这个是本月的
    @GET(Constant.SALE_MONTH_SUM)
    Call<String> saleMonthSum(@Query(value = "org") Integer org);

    //本日销售额
    @GET(Constant.SALE_DAY_SUM)
    Call<String> saleDaySum(@Query(value = "org") Integer org, @Query(value = "date") String date);
    //搜索
    @GET(Constant.SELECT_SALE)
    Call<String> selectSale(@Query(value = "org") Integer org, @Query(value = "startTime") String startTime,
                            @Query(value = "overTime") String overTime);
}
